<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center">
    <button
        mat-button
        color="accent"
        matTooltip="Data Preview"
        [matTooltipPosition]="'above'"
        (click)="togglePreviewEmitter.emit()"
    >
        <div fxLayoutAlign="start center" fxLayout="row">
            <i class="material-icons">visibility</i>
            <span *ngIf="!previewModeActive">&nbsp;Enable live preview</span>
            <span *ngIf="previewModeActive">&nbsp;Disable live preview</span>
        </div>
    </button>
    <button
        mat-button
        color="accent"
        matTooltip="Pipeline as code"
        [matTooltipPosition]="'above'"
        (click)="openCodeDialogEmitter.emit()"
    >
        <div fxLayoutAlign="start center" fxLayout="row">
            <i class="material-icons">code</i>
            <span>&nbsp;View pipeline as code</span>
        </div>
    </button>
    <div fxFlex></div>
    <div fxLayoutAlign="end center">
        <button
            mat-button
            color="accent"
            class="mr-10"
            matTooltip="Refresh"
            (click)="reloadMetricsEmitter.emit()"
        >
            <i class="material-icons">refresh</i>
            &nbsp;Refresh metrics
        </button>
        <mat-slide-toggle
            [(ngModel)]="autoRefresh"
            (ngModelChange)="autoRefreshChange.emit($event)"
            color="accent"
            >Auto refresh
        </mat-slide-toggle>
    </div>
</div>
